﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;

public partial class Controls_FooterNavigationHome : Base_Controls
{
    protected void Page_Load(object sender, EventArgs e)
    {
        base.setField(Convert.ToInt32(this.Attributes["ID"]));
        if (!IsPostBack)
        {
            loadData();
        }
    }
    protected void loadData()
    {
        DataTable objDT = BO_portal_categories.SelectByParent(base.Cid, 1);
        int counter = objDT.Rows.Count;
        for (int i = 4; i < counter; i++)
        {
            objDT.Rows.RemoveAt(objDT.Rows.Count - 1);
        }
        if (base.Lang)
        {
            foreach (DataRow row in objDT.Rows)
            {
                row["FULL_CATEGORY_NAME"] = row["FULL_CATEGORY_NAME_ENG"];
            }
        }
        rptNavi.DataSource = objDT;
        rptNavi.DataBind();
    }

    protected DataTable loadChildren(string parent_id)
    {
        DataTable objDT = BO_portal_categories.SelectByParent(Convert.ToInt32(parent_id), 1);
        if (Request["lang"] == "1")
        {
            foreach (DataRow row in objDT.Rows)
            {
                row["FULL_CATEGORY_NAME"] = row["FULL_CATEGORY_NAME_ENG"];
            }
        }
        return objDT;
    }
}